package com.bdsoft.auth.Service.impl;

import com.bdsoft.auth.Mapper.LoginMapper;
import com.bdsoft.auth.Service.LoginService;
import com.bdsoft.auth.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;

    @Override
    public User findByUsername(String username) {
        return loginMapper.selectByUsername(username);
    }

    @Override
    public List<Map<String, Object>> findUserRole(String id) {
        return loginMapper.selectUserRole(id);
    }

    // 新增方法
    public User findById(String id) {
        return loginMapper.selectById(id);
    }
}